import { IFeidaoAiBrowserComponent } from '@dfeidao/atom-web/interfaces';
import nodejs from '@dfeidao/atom-web/msg/nodejs';
import render from '@dfeidao/atom-web/render/render';
import p001 from './p001';
import p002 from './p002';

export default async function a002(fd: IFeidaoAiBrowserComponent) {
	// todo
	//搜索
	const company_name = fd.data.node.querySelector<HTMLInputElement>('[data-id="company_name"]').value;
	const corporate = fd.data.node.querySelector<HTMLInputElement>('[data-id="corporate"]').value;

	const res = await nodejs<{ dt: Array<{}>, t: number }>('company-factory/zj-000004/s001', {
		filter: {
			company_name: company_name,
			corporate: corporate,
			pn: 1
		}
	});
	console.log(res);
	render(fd, res.dt, p001, 'p001', 'inner');
	render(fd, res.t, p002, 'p002', 'inner');
}
